import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import com.bigmodel.contant.AmdbId;
import com.bigmodel.contant.StepId;
import com.bigmodel.contant.SystemName;
import com.bigmodel.contant.VerbName;
import com.bigmodel.entity.QAEntity;
import com.bigmodel.util.ExcelUtil;
import com.bigmodel.util.FtlUtil;
import org.junit.Test;

import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DateTimeSFT {

    private final static  String OUT_PATH = "D:\\qa_datetime\\";

    private final static String FREEMARKER_BASE_PATH = "sft/datetime/";

    private static final int randomNumber = 20;


    private static List<String> verbList = null;
    private static List<String> systemNameList = null;
    private static List<String> nameList = null;
    private static List<String> stepIdList = null;

    private static String[] num1_60 = { "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "二十一", "二十二", "二十三", "二十四", "二十五", "二十六", "二十七", "二十八", "二十九", "三十", "三十一", "三十二", "三十三", "三十四", "三十五", "三十六", "三十七", "三十八", "三十九", "四十", "四十一", "四十二", "四十三", "四十四", "四十五", "四十六", "四十七", "四十八", "四十九", "五十", "五十一", "五十二", "五十三", "五十四", "五十五", "五十六", "五十七", "五十八", "五十九", "六十"};
    private static String[] number1_60 =  {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
    private static String[] num1_12 = {"一","二","三","四","五","六","七","八","九","十","十一","十二"};
    private static String[] number1_12 = {"1","2","3","4","5","6","7","8","9","10","11","12"};

    private static String[] number0_23 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"};
    private static String[] number1_30 = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23","24","25","26","27","28","29","30"};
    private static String[] number0_59 =  {"0", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "59"};



    static {
        systemNameList = ListUtil.toList(SystemName.LIST_ARRAY);
        verbList = ListUtil.toList(VerbName.LIST_ARRAY);
        nameList = ListUtil.toList(AmdbId.LIST_ARRAY);
        stepIdList = ListUtil.toList(StepId.LIST_ARRAY);
    }


    public static void main(String[] args) {
       /* T001();//今天,九点过五分,今天九点过五分
        T002();//昨天，昨天9点8分,昨天九点五分
        T003();//前天,
        T004();//明天,*/
        T005();//日期描述： 明天、今天、后天、大后天、昨天、前天、大前天。 如不包含时间描述，则代表对应日期一整天 时间描述： 9点, 9点15, 9点15到58, 9点15到10点15, 9点到10点, etc.
        T006();//今天到现在
        T007();//今天上午
        T008();//三天前
        T009();//2023/8/10 17:50
        T010();//最近三小时
        T011();//下午1点到3点
        T012();//早上/上午/今天11点到12点
        T013();//3小时内
        T014();//1点到现在
        T015();//下午6点
        T016();//12-13点
        T017();//10点左右
        T018();//8月12号
        T019();// 2023/08/10, 2023-08-10, 2023年8月18日， 2023年8月18号

    }


    private static void T001(){
        String code = "T001";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        int numberHour = 1;
        for (String hour : num1_12) {
            int numberMin = 1;
            for(String min: num1_60) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = hour + "点过"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("numberHour",numberHour);
                map.put("numberMin",numberMin);

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                numberMin++;
            }
            numberHour++;
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();
        numberHour = 1;
        for (String hour : num1_12) {
            int numberMin = 1;
            for(String min: num1_60) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "今天"+hour + "点过"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("numberHour",numberHour);
                map.put("numberMin",numberMin);

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                numberMin++;
            }
            numberHour++;
        }
        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        ExcelUtil.createExcel(allEntityList,OUT_PATH+code+".xls");
    }


    private static void T002(){
        String code = "T002";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "昨天";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startnumberHour",0);
            map.put("startnumberMin",0);
            map.put("endnumberHour",23);
            map.put("endnumberMin",59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        for (String hour : number0_23) {
            for(String min: number0_59) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "昨天"+hour+"点"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",hour);
                map.put("startnumberMin",min);
                map.put("endnumberHour",hour);
                map.put("endnumberMin",min);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        int numberHour = 1;
        for (String hour : num1_12) {
            int numberMin = 1;
            for(String min: num1_60) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "昨天"+hour+"点过"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",numberHour);
                map.put("startnumberMin",numberMin);
                map.put("endnumberHour",numberHour);
                map.put("endnumberMin",numberMin);

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                numberMin++;
            }
            numberHour++;
        }
        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();
        ExcelUtil.createExcel(allEntityList,OUT_PATH+code+".xls");
    }

    private static void T003(){
        String code = "T003";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        List<QAEntity> allEntityList = new ArrayList<>();

        for (String hour : number0_23) {
            for(String min: number0_59) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "前天"+hour+"点"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",hour);
                map.put("startnumberMin",min);
                map.put("endnumberHour",hour);
                map.put("endnumberMin",min);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();


        int numberHour = 1;
        for (String hour : num1_12) {
            int numberMin = 1;
            for(String min: num1_60) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "前天"+hour+"点过"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",numberHour);
                map.put("startnumberMin",numberMin);
                map.put("endnumberHour",numberHour);
                map.put("endnumberMin",numberMin);

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                numberMin++;
            }
            numberHour++;
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "前天";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startnumberHour",0);
            map.put("startnumberMin",0);
            map.put("endnumberHour",23);
            map.put("endnumberMin",59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }
        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        ExcelUtil.createExcel(allEntityList,OUT_PATH+code+".xls");
    }


    private static void T004(){
        String code = "T004";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();


        for (String hour : number0_23) {
            for(String min: number0_59) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "明天"+hour+"点"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",hour);
                map.put("startnumberMin",min);
                map.put("endnumberHour",hour);
                map.put("endnumberMin",min);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();


        int numberHour = 1;
        for (String hour : num1_12) {
            int numberMin = 1;
            for(String min: num1_60) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "明天"+hour+"点过"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",numberHour);
                map.put("startnumberMin",numberMin);
                map.put("endnumberHour",numberHour);
                map.put("endnumberMin",numberMin);

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                numberMin++;
            }
            numberHour++;
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "明天";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startnumberHour",0);
            map.put("startnumberMin",0);
            map.put("endnumberHour",23);
            map.put("endnumberMin",59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }
        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        ExcelUtil.createExcel(allEntityList,OUT_PATH+code+".xls");
    }


    /**
     * 日期描述： 明天、今天、后天、大后天、昨天、前天、大前天。 如不包含时间描述，则代表对应日期一整天<br/>
     * 时间描述： 9点, 9点15, 9点15到58, 9点15到10点15, 9点到10点, etc.
     *
     */
    private static void T005(){
        String code = "T005";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        Object[][] dateDescriptors = new Object[][]{{"",0} ,{"明天", 1}, {"今天",0} , {"后天",2}, {"大后天", 3},{"昨天", -1}, {"前天", -2}, {"大前天", -3}};


        for (int i=0; i<randomNumber; i++) {
            Object[] endDateDescriptors = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length-1)];
            Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length-1)];
            String dateDescriptorName = (String)startDateDescriptor[0];
            int startDayStep = (int)startDateDescriptor[1];
            String endDateDescriptorName = (String)endDateDescriptors[0];
            int endDayStep = (int)endDateDescriptors[1];

            if ((int)endDateDescriptors[1] < (int)startDateDescriptor[1]) {
                endDateDescriptorName = dateDescriptorName;
                endDayStep = startDayStep;
                startDayStep = (int)endDateDescriptors[1];
                dateDescriptorName = (String)endDateDescriptors[0];
            }


            // 明天/后天/大后天
            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName;

                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startnumberHour", 00);
                map.put("startnumberMin", 00);
                map.put("endnumberHour", 23);
                map.put("endnumberMin", 59);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            // 明天到后天
            {

                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName, endtimestr = endDateDescriptorName;

                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", endtimestr);
                map.put("startDay", startDayStep);
                map.put("endDay", endDayStep);
                map.put("startnumberHour", 00);
                map.put("startnumberMin", 00);
                map.put("endnumberHour", 00);
                map.put("endnumberMin", 00);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            // 明天10点到后天10点
            {
                int starthour = RandomUtil.randomInt(0, 23);
                int startmin = RandomUtil.randomInt(0, 59);
                int endhour = RandomUtil.randomInt(0, 23);
                int endmin = RandomUtil.randomInt(0, 59);

                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName+ starthour +"点" + startmin, endtimestr = endDateDescriptorName + endhour + '点' + endmin;

                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", endtimestr);
                map.put("startDay", startDayStep);
                map.put("endDay", endDayStep);
                map.put("startnumberHour", starthour);
                map.put("startnumberMin", startmin);
                map.put("endnumberHour", endhour);
                map.put("endnumberMin", endmin);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }


        for (Object[] dateDescriptor : dateDescriptors) {
            Object[] endDateDescriptors = dateDescriptors[RandomUtil.randomInt(0, dateDescriptors.length-1)];
            String dateDescriptorName = (String)dateDescriptor[0];
            int startDayStep = (int)dateDescriptor[1];
            String endDateDescriptorName = (String)endDateDescriptors[0];
            int endDayStep = (int)endDateDescriptors[1];

            for (int i=0; i<randomNumber; i++) {
                int hour = RandomUtil.randomInt(0, 23);
                int min = RandomUtil.randomInt(0, 59);

                // 明天9点， 后天9点15。 大后天9点15分和大后天9点15属于一个类别
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = null;
                    if (min == 0) {
                        starttimeStr = dateDescriptorName + hour + "点";
                    } else {
                        starttimeStr = dateDescriptorName + hour + "点" + min;
                    }
                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", null);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", min);
                    map.put("endnumberHour", hour);
                    map.put("endnumberMin", min);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 明天9点
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = dateDescriptorName + hour + "点";
                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", null);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", min);
                    map.put("endnumberHour", hour);
                    map.put("endnumberMin", "00");
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 明天9点过5分
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = null;
                    if (min >= 0) {
                        starttimeStr = dateDescriptorName + hour + "点过" + min + "分";
                        map.put("starttimeStr", starttimeStr);
                        map.put("endtimeStr", null);
                        map.put("startDay", startDayStep);
                        map.put("endDay", startDayStep);
                        map.put("startnumberHour", hour);
                        map.put("startnumberMin", min);
                        map.put("endnumberHour", hour);
                        map.put("endnumberMin", min);
                        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                        String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                        qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                    }
                }


                // 明天9点15到58
                {
                    int endMin = RandomUtil.randomInt(1,59);
                    // 数值交换
                    if (endMin < min) {
                        endMin = endMin + min;
                        min = endMin - min;
                        endMin = endMin - min;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr =  dateDescriptorName + hour + "点" + min ;
                    String endtimeStr =  "" +endMin;

                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", endtimeStr);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", min);
                    map.put("endnumberHour", hour);
                    map.put("endnumberMin", endMin);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 后天9点15到10点58
                {
                    int endHour = RandomUtil.randomInt(1,23);
                    int endMin = RandomUtil.randomInt(1,59);
                    // 数值交换
                    if (endMin < min) {
                        endMin = endMin + min;
                        min = endMin - min;
                        endMin = endMin - min;
                    }
                    if (endHour < hour) {
                        endHour = endHour + hour;
                        hour = endHour - hour;
                        endHour = endHour - hour;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr =  dateDescriptorName + hour + "点" + min ;
                    String endtimeStr = "" + endHour + '点' + endMin;

                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", endtimeStr);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", min);
                    map.put("endnumberHour", endHour);
                    map.put("endnumberMin", endMin);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 后天9点到10点
                {
                    int endHour = RandomUtil.randomInt(1,23);
                    int endMin = RandomUtil.randomInt(1,59);
                    // 数值交换
                    if (endMin < min) {
                        endMin = endMin + min;
                        min = endMin - min;
                        endMin = endMin - min;
                    }
                    if (endHour < hour) {
                        endHour = endHour + hour;
                        hour = endHour - hour;
                        endHour = endHour - hour;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr =  dateDescriptorName + hour + "点";
                    String endtimestr =  endHour + "点";

                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", endtimestr);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", "00");
                    map.put("endnumberHour", endHour);
                    map.put("endnumberMin", "00");
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

            }


        }

        ExcelUtil.createExcel(qaEntityList,OUT_PATH+code+".xls");
    }


    private static void T006(){
        String code = "T006";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "今天到现在";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startnumberHour",0);
            map.put("startnumberMin",0);
            map.put("endnumberHour",23);
            map.put("endnumberMin",59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList,OUT_PATH+code+".xls");
    }


    private static void T007(){
        String code = "T007";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "今天上午";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startnumberHour",0);
            map.put("startnumberMin",0);
            map.put("endnumberHour",23);
            map.put("endnumberMin",59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList,OUT_PATH+code+".xls");
    }


    private static void T008(){
        String code = "T008";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();


        for (String hour : number0_23) {
            for(String min: number0_59) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "三天前"+hour+"点"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",hour);
                map.put("startnumberMin",min);
                map.put("endnumberHour",hour);
                map.put("endnumberMin",min);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        int numberHour = 1;
        for (String hour : num1_12) {
            int numberMin = 1;
            for(String min: num1_60) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "三天前"+hour+"点过"+min+"分";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startnumberHour",numberHour);
                map.put("startnumberMin",numberMin);
                map.put("endnumberHour",numberHour);
                map.put("endnumberMin",numberMin);

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                numberMin++;
            }
            numberHour++;
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "三天前";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startnumberHour",0);
            map.put("startnumberMin",0);
            map.put("endnumberHour",23);
            map.put("endnumberMin",59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }
        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();
        ExcelUtil.createExcel(allEntityList,OUT_PATH+code+".xls");
    }


    private static void T009() {
        String code = "T009";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int i=0; i<randomNumber; i++) {

            int year = RandomUtil.randomInt(2010, 2040);
            int month = RandomUtil.randomInt(1, 12);
            int day = RandomUtil.randomInt(1, 31);
            int hour = RandomUtil.randomInt(0, 23);
            int min = RandomUtil.randomInt(0, 59);
            int sec = RandomUtil.randomInt(0, 59);

            int[] middleMonth = new int[]{4, 6, 9, 11};
            int littleMonth = 2;

            if (month == littleMonth && day > 28) {
                day = 28;
            } else {
                for (int lm : middleMonth) {
                    if (lm == month && day > 30) {
                        day = 30;
                        break;
                    }
                }
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "/" + month + "/" + day + " " + hour + ":" + min;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", "00");
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", "00");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "/" + month + "/" + day + " " + hour + ":" + min + ":" + sec;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", sec);
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", sec);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "-" + month + "-" + day + " " + hour + ":" + min;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", "00");
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", "00");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", sec);
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", sec);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T010() {
        String code = "T010";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        int i = 1;
        for (String hour : num1_12) {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "最近"+hour+"小时";
            map.put("starttimeStr", starttimeStr);
            map.put("hour", i);
            i++;
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));

        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        for (String hour : number1_12) {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "最近"+hour+"小时";
            map.put("starttimeStr", starttimeStr);
            map.put("hour", hour);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));

        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        allEntityList.addAll(qaEntityList);
        qaEntityList = new ArrayList<>();

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T011() {
        String code = "T011";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        String[] dayArr = {"下午","晚上"};
        for(String day : dayArr) {
            for (int x = 1; x <= 11; x++) {
                for (int y = 2; y <= 12; y++) {
                    if(y<x){
                        continue;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = day + x + "点到" + y + "点";

                    map.put("starttimeStr", starttimeStr);
                    map.put("starthour", x);
                    map.put("endhour", y);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
        }

        if(qaEntityList.size()>100) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T012() {
        String code = "T012";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        String[] dayArr = {"早上","今天","上午"};

        for(String day : dayArr) {
            for (int x = 1; x <= 11; x++) {
                for (int y = 2; y <= 12; y++) {
                    if(y<x){
                        continue;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = day + x + "点到" + y + "点";
                    map.put("starttimeStr", starttimeStr);
                    map.put("starthour", x);
                    map.put("endhour", y);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T013() {
        String code = "T013";
        String category = "";
        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int x = 1; x <= 10; x++) {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = x + "小时内";
            map.put("starttimeStr", starttimeStr);
            map.put("starthour", x);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T014() {
        String code = "T014";
        String category = "";
        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int x = 1; x <= 10; x++) {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = x + "点到现在";
            map.put("starttimeStr", starttimeStr);
            map.put("starthour", x);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T015() {
        String code = "T015";
        String category = "";
        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int x = 1; x <= 10; x++) {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "下午"+x+"点";
            map.put("starttimeStr", starttimeStr);
            map.put("starthour", x);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T016() {
        String code = "T016";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int x = 1; x <= 11; x++) {
            for (int y = 2; y <= 12; y++) {
                if(y<x){
                    continue;
                }
                Map<String, Object> map = new HashMap<>();
                String starttimeStr =  x + "-" + y + "点";
                map.put("starttimeStr", starttimeStr);
                map.put("starthour", x);
                map.put("endhour", y);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T017() {
        String code = "T017";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int x = 1; x <= 10; x++) {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr =  x  + "点左右";
            map.put("starttimeStr", starttimeStr);
            map.put("starthour", x);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T018() {
        String code = "T018";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int x = 6; x <= 10; x++) {
            for (int y = 12; y <= 20; y++) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = x + "月"+y+"号";
                map.put("starttimeStr", starttimeStr);
                map.put("month", x);
                map.put("day", y);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if(qaEntityList.size()>50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T019() {
        String code = "T019";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int i=0; i<randomNumber; i++) {

            int year = RandomUtil.randomInt(2010, 2040);
            int month = RandomUtil.randomInt(1, 12);
            int day = RandomUtil.randomInt(1, 31);

            int[] middleMonth = new int[]{4, 6, 9, 11};
            int littleMonth = 2;

            if (month == littleMonth && day > 28) {
                day = 28;
            } else {
                for (int lm : middleMonth) {
                    if (lm == month && day > 30) {
                        day = 30;
                        break;
                    }
                }
            }

            {
                // rt: 2023/08/10
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "/" + month + "/" + day;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year+"");
                map.put("month", month+"");
                map.put("day", day+"");
                map.put("hour", "00");
                map.put("min", "00");
                map.put("seconds", "00");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                // rt: 2023-08-10
                Map<String, Object> map = new HashMap<>();
                String starttimeStr =year + "-" + month + "-" + day;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year+"");
                map.put("month", month+"");
                map.put("day", day+"");
                map.put("hour", "00");
                map.put("min", "00");
                map.put("seconds", "00");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                // rt: 2023年8月10日
                Map<String, Object> map = new HashMap<>();
                String starttimeStr =year + "年" + month + "月" + day + "日";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year+"");
                map.put("month", month+"");
                map.put("day", day+"");
                map.put("hour", "00");
                map.put("min", "00");
                map.put("seconds", "00");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                // rt: 2023年8月10号
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "年" + month + "月" + day + "号";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year+"");
                map.put("month", month+"");
                map.put("day", day+"");
                map.put("hour", "00");
                map.put("min", "00");
                map.put("seconds", "00");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

        }

        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }





    @Test
    public void test1(){
        //获取基准时间
        LocalDateTime now = LocalDateTime.now();
        //步骤一:开始时间计算
        //步骤一:开始时间计算
        LocalDateTime startTime =  LocalDateTime.now().plusHours(2);
        //步骤二:结束时间计算
        LocalDateTime endTime = now.toLocalDate().atTime(14,0);
        //步骤三:格式化开始时间,结束时间
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String startTimeStr = formatter.format(startTime);
        String endTimeStr = formatter.format(endTime);
        System.out.println(startTimeStr);
        System.out.println(endTimeStr);

    }


    @Test
    public void test2(){

        for(int i = 0 ; i <100;i++){
            System.out.println(RandomUtil.randomLong(1,4));
        }
    }

    public static List<QAEntity> random50List(List<QAEntity> allList){
        List<QAEntity> newList = new ArrayList<>();

        for(int i = 0 ; i < 50 ;i++){
            newList.add(allList.get(RandomUtil.randomInt(0,allList.size())));
        }
        return newList;
    }


}
